package cn.bjc.feign;

import cn.bjc.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient(value = "user-service", fallbackFactory = UserFallback.class)
//被调用方如果有一级路径,必须加这个注解,否则报错
@RequestMapping("/user")
public interface UserFeignService {
    
    @GetMapping("/getById/{id}")
    User getById(@PathVariable("id") Long id);
    
}
